# -*- coding: utf-8 -*-
# @Time: 2022/7/8 11:27
# @Author: 发抖的小喵喵
# @Email: panyi_20210601@163.com
# @File: 退单品计费接口（新增）.py
# @Project: haixin
# @Software: PyCharm


from test_case.haixin.Method.Post import post_method


def returnFeeItem():
    """
    调用接口查询计算的退款费用同步到我们数据库
    :return:
    """
    url = "https://api-stg.shwoody.com/V2/ma/reOrder/refundFeeItem"

    data = {
        "shopId": "80101",
        "cashNo": "0007",  # 收款机号
        "saleNo": "2023091217572748870",  # 销售流水号
        "userId": "1514150660671672320",  # 整单退userId非必填
        "items": [
            {
                "skuId": "321123",
                "salePrice": 50,  # 销售单价  此处单价未做校验
                "qty": 1  # 数量
            },
            # {
            #     "skuId": "100020",
            #     "salePrice": 2,  # 销售单价  此处单价未做校验
            #     "qty": 2  # 数量
            # }
        ]
    }

    response = post_method(data, url)
    print("接口响应数据：" + str(response))

    # 若潮豆已生效，查询的时候即冻结了已生效潮豆


if __name__ == "__main__":
    returnFeeItem()
